package com.apes.enquiry.product.repository;

import com.apes.enquiry.product.model.AutomobileBrand;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

public interface AutomobileBrandRepository extends CustomRepository<AutomobileBrand,String> {

    @Query(value = "select a.automobileBrand from AutomobileBrand a")
    List<String> findAllName();

    AutomobileBrand findByautomobileBrand(String byautomobileBrand);

    @Query(value = "select a.automobileBrand as name from AutomobileBrand a")
    List<Map<String, String>> nameList();

    @Query(value = "select a.id from AutomobileBrand a WHERE a.automobileBrand=:name")
    String findByAutomobileBrand(@Param("name") String name);

}
